implemented warn and crit params, to check response time
better error handling
code cleanup