fixed issue with and refactored report