debug and proper return values