Can you give suggestions on how we can control non-members from joining the classes?

Our group class studio is located on a floor separate from the main gym, people with expired memberships and client's guess most of the time come in without registerting at the main floor.