Added custom callback function for directive, and shorten the timeouts