solved bug tickets #2, #26, #27, #28, #31