got stopped on a bike after hours with no lights on the bike. name was ran no outstanding warrents name was clean. office asked to pat me down for any weapons and ask me to take my hat off after my name was ran. cocain was found and i got arrested. was that legal. the pat down and all.