fixed minor bug in checking menu layer