fixed depth clearing bug