Stored Procedure added instead of inline query - WORKING