added pin check and return only status to check function